load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/k8s.io/artifactserver/cmd/artifactserver",
    visibility = ["//visibility:private"],
    deps = ["@io_k8s_klog//:go_default_library"],
)

go_binary(
    name = "artifactserver",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)

load("@io_bazel_rules_docker//go:image.bzl", "go_image")

go_image(
    name = "image",
    embed = [":go_default_library"],
    goarch = "amd64",
    goos = "linux",
    pure = "on",
    visibility = ["//visibility:public"],
)

load("@io_bazel_rules_docker//container:container.bzl", "container_push")

container_push(
    name = "push-image",
    format = "Docker",
    image = ":image",
    registry = "{STABLE_DOCKER_REGISTRY}",
    repository = "{STABLE_DOCKER_IMAGE_PREFIX}artifactserver",
    stamp = True,
    tag = "{STABLE_DOCKER_TAG}",
)
